package com.senter.data.dbflow.model;

import com.raizlabs.android.dbflow.annotation.Column;
import com.raizlabs.android.dbflow.annotation.ForeignKey;
import com.raizlabs.android.dbflow.annotation.ForeignKeyReference;
import com.raizlabs.android.dbflow.annotation.ManyToMany;
import com.raizlabs.android.dbflow.annotation.MultipleManyToMany;
import com.raizlabs.android.dbflow.annotation.PrimaryKey;
import com.raizlabs.android.dbflow.annotation.Table;
import com.raizlabs.android.dbflow.structure.BaseModel;
import com.senter.data.dbflow.db.DemoDataBase;

@Table(name = "person",database = DemoDataBase.class)
//@ManyToMany(referencedTable = Role.class)
@MultipleManyToMany({@ManyToMany(referencedTable = Role.class),@ManyToMany(referencedTable = Project.class)})
public class Person extends BaseModel {

    @PrimaryKey(autoincrement = true)
    private int id;

    @ForeignKey(references = {@ForeignKeyReference(columnName = "deptId", foreignKeyColumnName = "id")}, saveForeignKeyModel = false, stubbedRelationship = true)
    Department department;

    @Column
    private String name;

    @Column
    private String sex;

    @Column
    private int age;

    @Column
    private String telephone;

    @Column
    private String email;

    @Column
    private String address;

    @Column
    private String remark;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Department getDepartment() {
        return department;
    }

    public void setDepartment(Department department) {
        this.department = department;
    }
}
